/***************************/
/*Bat dau ham xoa 1 hoc sinh*/
function Xoa(id) {
	//var url = "temp.php?idXoa=" + id;
  	//document.location.href = url
	
	
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	
	var url = "xlXoa.php?idXoa=" + id;

	xmlhttp.onreadystatechange=xoa_stateChanged;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	
	 
}
function xoa_stateChanged()
{
		
	if (xmlhttp.readyState==4)
	{
		
		
		if (xmlhttp.status == 200)
		{
		
			//var xmlDoc=xmlhttp.responseXML.documentElement;		
			//var xmlDoc=xmlhttp.responseXML;
			
			//var response_stat = xmlDoc.getElementsByTagName("deleted")[0].childNodes[0].nodeValue;			
			//var response_stat=xmlDoc.getElementsByTagName("deleted")[0].firstChild.data;			
			
			var response_stat=xmlhttp.responseText;
			
            if(response_stat == 1)
			{
				alert('Deleted row successfully.');
				hienthids();
			}
			else
			{
				alert('Failed to delete');
			}
		} 
	}
}
/*Ket thuc ham xoa 1 hoc sinh*/
/***************************/



/***************************/
/*Bat dau ham xoa nhieu hoc sinh*/

function XoaNhieu()
{
	var chk = document.getElementsByName('chkMaHSs[]');
	for(i=0; i<chk.length; i++)
	{
		if(chk[i].checked)
			Xoa(chk[i].value);
	}
}

/*Ket thuc ham xoa nhieu hoc sinh*/
/***************************/

/***************************/
/*Bat dau ham xoa nhieu hoc sinh*/
/*
function XoaNhieu() {
	
	xmlhttp=GetXmlHttpObject();
	if (xmlhttp==null)
	{
		alert ("Browser does not support HTTP Request");
		return;
	}
	var url = "xlXoa.php?=mang" + document.getElementsByName("chkMaHSs");
	xmlhttp.onreadystatechange=xoanhieu_stateChanged;
	xmlhttp.open("POST",url,true);
	xmlhttp.send(null);
	
	 hienthids();
}

function xoanhieu_stateChanged()
{
		
	if (xmlhttp.readyState==4)
	{
	
		if (xmlhttp.status == 200)
		{
			
	
			var response_stat=xmlhttp.responseText;
			
            if(response_stat == 1)
			{
				alert('Deleted rows successfully.');
			}
			else
			{
				alert('Failed to delete');
			}
		} 
	}
}
*/
/*Ket thuc ham xoa nhieu hoc sinh*/
/***************************/

